Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #1562 +/- ##
===========================================
+ Coverage 20.67% 20.81% +0.13%
===========================================
Files 1148 1148
Lines 114416 114505 +89
===========================================
+ Hits 23653 23831 +178
+ Misses 90763 90674 -89 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Util.getSymbolsFor looks a locale string up in intl, falling back to its language. Where the device writes numbers otherwise, as English with a German region does (intl has no en_DE, so it falls back to en and gives "."), amounts are typed and shown with the wrong decimal separator while the system's number keyboard offers ",". Util.deviceNumberFormat takes the separators the device reports and returns the key getSymbolsFor gives them by: the locale itself where intl already has those separators, else a key of its own. A locale asked for by name, like the canonical "en_US", keeps intl's separators.
devicelocale gives a locale name, from which the decimal separator was looked up in intl. On iOS an app that declares only English gets English as its language, so a German iPhone reports en_DE and amounts took "." while the decimal pad shows ",". In an iOS 27 simulator that happened for en_DE, en_FR, en_NL, de_DE and separators customized apart from the region; cs_locale matched the decimal pad in each. Windows was fixed to en_US. LocaleService now reads the separators from the system with cs_locale on every platform, and keys them with Util.deviceNumberFormat. It also follows the system's announcements, so a number format changed on its own, which Flutter doesn't report, reaches the amount fields too. cs_locale is pinned to the 0.1.0 release commit until it is on pub.dev; 0.0.1 fails to configure under this app's Android Gradle plugin.
sneurlax
force-pushed
the
feat/cs-locale
branch
from
December 3, 2026 20:39
f3dc65e to
72a34fa
Compare
sneurlax
marked this pull request as ready for review
December 3, 2026 23:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces devicelocale with cs_locale, so amounts are typed and shown with the decimal separator the system uses.
Some users see
.in Stack Wallet while their system writes numbers with,. The separator came from looking devicelocale's locale name up in intl, falling back to the language alone. intl has no en_DE or en_NL, so English with a European region got.. On iOS it is broader: an app that declares only English can receive an English language tag even when the system number format uses a comma. Windows was fixed to en_US.A probe app ran Stack Wallet's lookup next to cs_locale and a number field:
.,,.,,.,,.,,(Gboard shows both keys).,,In every other setup tried (en-US, en-150, de-DE, fr-FR, de_CH) all three agree.
Changes
Util.deviceNumberFormatturns the separators the device reports into the keyUtil.getSymbolsFortakes: the locale itself where intl has the same separators, otherwise a key of its own. A locale requested by name, such as the canonicalen_USinwallet_tools.dart, keeps intl's separators.LocaleServicereads the device with cs_locale on every platform and follows its change stream, including number-format changes that Flutter does not report..or,decimal-key insertion, covering Android numeric keyboards that do not expose the locale separator, while pasted/grouped input remains rejected.DateFormat, preventingLocaleDataExceptionwhen a customized number format is active.LocaleService.localechanges.^0.1.0package rather than a temporary Git pin.Testing
Not run here: a physical Android keypad check or full iOS, macOS, and Windows app builds.